import {http} from "@/utils/http.js";

export const getNews=()=>{
    return http.get("/api/news")
}




//登录
export const LoginK=(data)=>{
    return http.post("/user/login",data)
}

//获取当前登录成员
export const getLoginUser=()=>{
    return http.get("/user/get/login")
}

/**
 *成员api
 */

//根据id获取成员
export const getMember=(id)=>{
    return http.get("/member/get/vo",{id:id})
}

//分页获取成员信息
export const listMemberVOByPage=(data)=>{
    return http.post("/member/list/page/vo",data)
}

//添加成员
export const addMember=(data)=>{
    return http.post("/member/add",data)
}

//删除成员
export const deleteMember=(data)=>{
    return http.post("/member/delete",data)
}

//编辑成员
export const editMember=(data)=>{
    return http.post("/member/edit",data)
}

//echarts
export const getMajorDistribution=()=>{
    return http.get("/member/getMajorDistribution")
}


export const getDepartmentDistribution=()=>{
    return http.get("/member/getDepartmentDistribution")
}







/*
 *部门相关
 */
export const getDeparments=()=>{
    return http.get("/department/getList")
}

//新增部门信息

export const addDepartment=(data)=>{
    return http.post("/department/add",data)
}

//删除部门
export const deleteDepartment=(data)=>{
    return http.post("/department/delete",data)
}
//编辑部门
export  const editDepartment=(data)=>{
    return http.post("/department/edit",data)
}

//根据名称查找部门
export const getDepartmentByName=(data)=>{
    return http.post("/department/list/page",data)
}



/*
* 项目相关
 */
export const getProjects=()=>{
    return http.get("/project/getList")
}
export const getQueryProject=(data)=>{
    return http.post("/project/list/page",data)
}

export const deleteProject=(data)=>{
    return http.post("/project/delete",data)
}

export const editProject=(data)=>{
    return http.post("/project/edit",data)
}
export const addProject=(data)=>{
    return http.post("/project/add",data)
}



//积分相关
export const getListIntegralVO=(data)=>{
    return http.post("/integral/list/page/vo",data)
}


export const editIntegral=(data)=>{
    return http.post("/integral/edit",data)
}



//公告通知
export const getAnnouncement=()=>{
    return http.get("/notification/getList")
}

export const addAnnouncement=(data)=>{
    return http.post("/notification/add",data)
}

export const deleteAnnouncment=(data)=>{
    return http.post("/notification/delete",data)
}

export const editAnnouncment=(data)=>{
    return http.post("/notification/edit",data)
}


//活动通知

export const getActivityListVO=()=>{
    return http.get("/activity/list")
}


export const addActivity=(data)=>{
    return http.post("/activity/add",data)
}


export const deleteActivity=(data)=>{
    return http.post("/activity/delete",data)
}


export const editActivity=(data)=>{
    return http.post("/activity/edit",data)
}